package com.sky.controller.user;

import com.sky.constant.RedisConstant;
import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

/**
 * 商铺管理
 */
@Api(tags = "商铺管理")
@RestController("UserShopController")
@RequestMapping("/user/shop")
public class ShopController {

    private static final Logger log = LoggerFactory.getLogger(ShopController.class);
    @Autowired
    private RedisTemplate redisTemplate;

    /**
     * 商铺状态获取
     * @return
     */
    @ApiOperation("商铺状态获取")
    @GetMapping("/status")
    public Result<Integer> shopQueryStatus(){
        log.info("商铺状态获取");
        Integer status = (Integer) redisTemplate.opsForValue().get(RedisConstant.SHOP_STATUS);
        return Result.success(status);
    }

}
